package com.xing.yunji.service;

import com.xing.yunji.model.domain.Team;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xing.yunji.model.domain.User;
import com.xing.yunji.model.domain.UserTeam;
import com.xing.yunji.model.dto.TeamQuery;
import com.xing.yunji.model.request.team.TeamJoinRequest;
import com.xing.yunji.model.request.team.TeamQuitRequest;
import com.xing.yunji.model.request.team.TeamUpdateRequest;
import com.xing.yunji.model.vo.TeamUserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author 17916
* @description 针对表【team(用户表)】的数据库操作Service
* @createDate 2023-04-08 12:06:32
*/
public interface TeamService extends IService<Team> {

    /**
     * 添加队伍
     * @param team
     * @param loginUser
     * @return
     */
    long addTeam(Team team, User loginUser);

    /**
     * 更新队伍
     * @param teamUpdateRequest
     * @param loginUser
     * @return
     */
    boolean updateTeam(TeamUpdateRequest teamUpdateRequest, User loginUser);

    /**
     * 查询队伍列表（根据查询条件）
     * @param teamQuery
     * @param isAdmin
     * @return
     */
    List<TeamUserVO> listTeams(TeamQuery teamQuery, boolean isAdmin);

    /**
     * 加入队伍
     * @param teamJoinRequest
     * @param request
     * @return
     */
    boolean joinTeam(TeamJoinRequest teamJoinRequest, HttpServletRequest request);




    /**
     * 用户退出队伍
     * @param teamQuitRequest
     * @param request
     * @return
     */
    boolean quitTeam(TeamQuitRequest teamQuitRequest, HttpServletRequest request);

    boolean deleteTeam(long id, HttpServletRequest request);
}
